// 连接数据库
const mongoose = require('mongoose');
const { stringify } = require('querystring');
mongoose.connect('mongodb://localhost/runoob');

const db = mongoose.connection;
db.on('error', console.error.bind(console, 'connection error'));
db.once('open', function () {
  console.log('db open');
});